package com.power.sifa.approve.model.doc;

import cn.hutool.core.util.ObjectUtil;
import com.power.sifa.approve.model.enumeration.Tp_procmaterial;
import lombok.Data;

/**
 * @ClassName AdmreAuditNotificationDoc
 * @Author xiongzw
 * @Date 2023/11/23 11:44
 * @Description // 行政复议告知书
 * @Version: 1.0
 **/

@Data
public class AdmreAuditNotificationDoc extends AbstractDoc {

    /**
     * 申请人
     */
    private String apl_admre_audit_applyname;

    /**
     * 正文
     */
    private String content;


    private final static String TEMPLATE = "    {pronoun}对{apl_admre_audit_targetname}[{behavior}]{prcode}不服,于{apl_main_subtime}提出的行政复议申请，根据《中华人民共和国行政复议法》《中华人民共和国行政复议法实施条例》等有关法律规定，应当依法向（有权管辖的行政复议机关）提出（自提出行政复议申请之日起至收到本告知书之日止的时间，不计入法定申请期限）";

    public AdmreAuditNotificationDoc() {
        super();
        this.setDocType(Tp_procmaterial.ARRIVE_INFORM);
    }

    public AdmreAuditNotificationDoc(String applyid) {
        super(applyid);
        this.setDocType(Tp_procmaterial.ARRIVE_INFORM);
    }


    public AdmreAuditNotificationDoc(String applyid, String content) {
        super(applyid);
        this.setDocType(Tp_procmaterial.ARRIVE_INFORM);
        this.content = content;
    }

    @Override
    public AbstractDoc generateTemplate(String applyid) {
        AdmreAuditNotificationDoc template = new AdmreAuditNotificationDoc(applyid);
        // 案号
        template.setApl_admre_audit_code(this.getApl_admre_audit_code());
        template.setApl_admre_audit_applyname(ObjectUtil.isNotNull(this.getAdmreObj()) ? this.getAdmreObj().getApplyname() : "");
        String content  = TEMPLATE.replace("{apl_admre_audit_targetname}", ObjectUtil.isNotNull(this.getAdmreObj()) ?
                    this.getAdmreObj().getTargetname() : "" );
        content = content.replace("{pronoun}", this.transPronoun());
        content = content.replace("{behavior}", this.transBehavior());
        content = content.replace("{prcode}", this.transPrcode());
        content = content.replace("{apl_main_subtime}", this.transSubtime());
        template.setContent(content);
        return template;
    }

}
